home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / TeXsource / beebe / com / ccom < prev   
Encoding:
Text File  |  1987-01-23  |  2.3 KB  |  80 lines

  1. $ SAVE_VERIFY = F$VERIFY()
  2. $ SET NOVERIFY
  3. $ !-----------------------------------------------------------------------
  4. $ ! Compile C files in connected directory:
  5. $ !
  6. $ ! Usage: @CCOM prefix compileoptions
  7. $ !
  8. $ ! where prefix is a wild-card specification of the names of .C files
  9. $ ! to be compiled.   
  10. $ !
  11. $ ! Examples:
  12. $ !    Compile everything:
  13. $ !    @CCOM *
  14. $ !
  15. $ !    Compile today's efforts:
  16. $ !    @CCOM * "" /SINCE
  17. $ !
  18. $ !    Compile certain routines changed since yesterday:
  19. $ !    @CCOM F%%%.C,G*.C,*UPD* /LIST/MACHINE_CODE /SINCE=YESTERDAY
  20. $ !
  21. $ ! Note in the  last example that  the extension .C  must be supplied
  22. $ ! for all but the last  file, which gets one  automatically.  In the
  23. $ ! second example, the switch /SINCE means the same as /SINCE:TODAY.
  24. $ ! [27-NOV-86]
  25. $ !-----------------------------------------------------------------------
  26. $ !
  27. $ ON CONTROL_Y THEN $ GOTO DONE
  28. $ !
  29. $ IF P1 .EQS. "" THEN INQUIRE P1 "Wild-card name of C files to compile"
  30. $ !
  31. $ DIRECTORY /VER=1/COL=1/NODATE/NOSIZE/NOHEAD/NOTRAIL/OUT=DIR.TMP'P3' 'P1'.C
  32. $ !
  33. $ IF .NOT. $STATUS THEN GOTO DIRECTORY_ERROR
  34. $ !
  35. $ OPEN /READ DIRFILE DIR.TMP
  36. $ !
  37. $ NEWLINE:
  38. $    READ /END=DONE DIRFILE NAME
  39. $    DEV := 'F$PARSE(NAME,,,"DEVICE")'
  40. $     DIR := 'F$PARSE(NAME,,,"DIRECTORY")'
  41. $     NAM := 'F$PARSE(NAME,,,"NAME")'
  42. $     EXT := 'F$PARSE(NAME,,,"TYPE")'
  43. $    LEADER := 'DEV''DIR''NAM'
  44. $    C_STAMP = F$FILE_ATTRIBUTES("''LEADER'.C","RDT")
  45. $    C_STAMP = F$CVTIME(C_STAMP)
  46. $    OBJ_STAMP = F$SEARCH("''LEADER'.OBJ")
  47. $    IF OBJ_STAMP .NES. "" THEN -
  48.         OBJ_STAMP = F$FILE_ATTRIBUTES("''LEADER'.OBJ","RDT")
  49. $    IF OBJ_STAMP .NES. "" THEN -
  50.         OBJ_STAMP = F$CVTIME(OBJ_STAMP)
  51. $    IF C_STAMP .LES. OBJ_STAMP THEN -
  52.         IF F$MODE() .EQS. "INTERACTIVE" THEN -
  53.             WRITE SYS$OUTPUT "''LEADER'.OBJ is up-to-date"
  54. $    IF C_STAMP .LES. OBJ_STAMP THEN -
  55.         GOTO NEWLINE
  56. $    WRITE SYS$OUTPUT "{",NAME,"}"
  57. $    SET NOON    ! Ignore errors
  58. $    DEFINE/USER SYS SYS$LIBRARY    ! so #include <sys/foo.h> works
  59. $    CC /NOLIST/DEBUG=(SYMBOLS,TRACEBACK) 'P2' 'NAME' /OBJECT='LEADER'.OBJ
  60. $    SET ON        ! Restore error checking
  61. $    GOTO NEWLINE
  62. $ !
  63. $ DONE:
  64. $    CLOSE DIRFILE/ERROR=NOTOPEN
  65. $ !
  66. $ NOTOPEN:
  67. $    SET FILE /PROTECTION=(W:REWD) DIR.TMP;*
  68. $    DELETE DIR.TMP;*
  69. $ !
  70. $ GOTO EXIT
  71. $ !
  72. $ DIRECTORY_ERROR:
  73. $    WRITE SYS$OUTPUT "Error: ''F$MESSAGE()'"
  74. $    SET FILE /PROTECTION=(W:REWD) DIR.TMP;*
  75. $    DELETE DIR.TMP;*
  76. $ !
  77. $ EXIT:
  78. $ IF SAVE_VERIFY THEN SET VERIFY
  79. $ EXIT
  80.